import 'package:testlzhu/generated/json/base/json_convert_content.dart';
import 'package:testlzhu/bean/home_bean_entity.dart';

HomeBeanEntity $HomeBeanEntityFromJson(Map<String, dynamic> json) {
	final HomeBeanEntity homeBeanEntity = HomeBeanEntity();
	final List<HomeBeanServices>? services = jsonConvert.convertListNotNull<HomeBeanServices>(json['services']);
	if (services != null) {
		homeBeanEntity.services = services;
	}
	final List<HomeBeanAds>? ads = jsonConvert.convertListNotNull<HomeBeanAds>(json['ads']);
	if (ads != null) {
		homeBeanEntity.ads = ads;
	}
	final bool? isShowRollnews = jsonConvert.convert<bool>(json['is_show_rollnews']);
	if (isShowRollnews != null) {
		homeBeanEntity.isShowRollnews = isShowRollnews;
	}
	final List<HomeBeanRollnews>? rollnews = jsonConvert.convertListNotNull<HomeBeanRollnews>(json['rollnews']);
	if (rollnews != null) {
		homeBeanEntity.rollnews = rollnews;
	}
	final int? isShowActivity = jsonConvert.convert<int>(json['is_show_activity']);
	if (isShowActivity != null) {
		homeBeanEntity.isShowActivity = isShowActivity;
	}
	final List<HomeBeanActivies>? activies = jsonConvert.convertListNotNull<HomeBeanActivies>(json['activies']);
	if (activies != null) {
		homeBeanEntity.activies = activies;
	}
	return homeBeanEntity;
}

Map<String, dynamic> $HomeBeanEntityToJson(HomeBeanEntity entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['services'] =  entity.services?.map((v) => v.toJson()).toList();
	data['ads'] =  entity.ads?.map((v) => v.toJson()).toList();
	data['is_show_rollnews'] = entity.isShowRollnews;
	data['rollnews'] =  entity.rollnews?.map((v) => v.toJson()).toList();
	data['is_show_activity'] = entity.isShowActivity;
	data['activies'] =  entity.activies?.map((v) => v.toJson()).toList();
	return data;
}

HomeBeanServices $HomeBeanServicesFromJson(Map<String, dynamic> json) {
	final HomeBeanServices homeBeanServices = HomeBeanServices();
	final String? code = jsonConvert.convert<String>(json['code']);
	if (code != null) {
		homeBeanServices.code = code;
	}
	final String? title = jsonConvert.convert<String>(json['title']);
	if (title != null) {
		homeBeanServices.title = title;
	}
	final String? icon = jsonConvert.convert<String>(json['icon']);
	if (icon != null) {
		homeBeanServices.icon = icon;
	}
	final int? showRighttopIcon = jsonConvert.convert<int>(json['show_righttop_icon']);
	if (showRighttopIcon != null) {
		homeBeanServices.showRighttopIcon = showRighttopIcon;
	}
	return homeBeanServices;
}

Map<String, dynamic> $HomeBeanServicesToJson(HomeBeanServices entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['code'] = entity.code;
	data['title'] = entity.title;
	data['icon'] = entity.icon;
	data['show_righttop_icon'] = entity.showRighttopIcon;
	return data;
}

HomeBeanAds $HomeBeanAdsFromJson(Map<String, dynamic> json) {
	final HomeBeanAds homeBeanAds = HomeBeanAds();
	final int? id = jsonConvert.convert<int>(json['id']);
	if (id != null) {
		homeBeanAds.id = id;
	}
	final String? title = jsonConvert.convert<String>(json['title']);
	if (title != null) {
		homeBeanAds.title = title;
	}
	final String? pic = jsonConvert.convert<String>(json['pic']);
	if (pic != null) {
		homeBeanAds.pic = pic;
	}
	final String? url = jsonConvert.convert<String>(json['url']);
	if (url != null) {
		homeBeanAds.url = url;
	}
	final int? positionid = jsonConvert.convert<int>(json['positionid']);
	if (positionid != null) {
		homeBeanAds.positionid = positionid;
	}
	final int? positionindex = jsonConvert.convert<int>(json['positionindex']);
	if (positionindex != null) {
		homeBeanAds.positionindex = positionindex;
	}
	return homeBeanAds;
}

Map<String, dynamic> $HomeBeanAdsToJson(HomeBeanAds entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['id'] = entity.id;
	data['title'] = entity.title;
	data['pic'] = entity.pic;
	data['url'] = entity.url;
	data['positionid'] = entity.positionid;
	data['positionindex'] = entity.positionindex;
	return data;
}

HomeBeanRollnews $HomeBeanRollnewsFromJson(Map<String, dynamic> json) {
	final HomeBeanRollnews homeBeanRollnews = HomeBeanRollnews();
	final int? id = jsonConvert.convert<int>(json['id']);
	if (id != null) {
		homeBeanRollnews.id = id;
	}
	final String? title = jsonConvert.convert<String>(json['title']);
	if (title != null) {
		homeBeanRollnews.title = title;
	}
	return homeBeanRollnews;
}

Map<String, dynamic> $HomeBeanRollnewsToJson(HomeBeanRollnews entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['id'] = entity.id;
	data['title'] = entity.title;
	return data;
}

HomeBeanActivies $HomeBeanActiviesFromJson(Map<String, dynamic> json) {
	final HomeBeanActivies homeBeanActivies = HomeBeanActivies();
	final String? title = jsonConvert.convert<String>(json['title']);
	if (title != null) {
		homeBeanActivies.title = title;
	}
	final String? pic = jsonConvert.convert<String>(json['pic']);
	if (pic != null) {
		homeBeanActivies.pic = pic;
	}
	final String? url = jsonConvert.convert<String>(json['url']);
	if (url != null) {
		homeBeanActivies.url = url;
	}
	final String? brief = jsonConvert.convert<String>(json['brief']);
	if (brief != null) {
		homeBeanActivies.brief = brief;
	}
	final String? fullPic = jsonConvert.convert<String>(json['full_pic']);
	if (fullPic != null) {
		homeBeanActivies.fullPic = fullPic;
	}
	return homeBeanActivies;
}

Map<String, dynamic> $HomeBeanActiviesToJson(HomeBeanActivies entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['title'] = entity.title;
	data['pic'] = entity.pic;
	data['url'] = entity.url;
	data['brief'] = entity.brief;
	data['full_pic'] = entity.fullPic;
	return data;
}